package compendiumAid.presentation
{
	import compendiumAid.application.exportElements.ExportElementsInitEvent;
	import compendiumAid.domain.model.ApplicationModel;
	
	import mx.collections.ArrayCollection;

	[ManagedEvents(names="ExportElementsEvent")]
	public class ApplicationPM extends PresentationModel
	{
		[Embed(source="embeddedAssets/styles/elementStyle.css", mimeType="application/octet-stream")]
		private var CSSClass:Class;
		
		[Inject]
		[Bindable]
		public var model:ApplicationModel;
		
		public function exportElements(elements:ArrayCollection):void
		{
			dispatcher(new ExportElementsInitEvent(elements));
		}
		
		[Init]
		public function init():void
		{
			var cssStringByteArray:Object = new CSSClass();
			cssStringByteArray = "<style type=\"text/css\">" + cssStringByteArray.toString() + "</style>\n";
				
			model.cssString = cssStringByteArray.toString();
		}
	}
}